var maxSlidingWindow = function(nums, k) {
    let res = [];
    const n = nums.length;
    let max,ans;
    for(let i = 0; i < n-k+1;i++) {
        // max = nums[i];
        // for(let j = i; j < i+k; j++) {
        //     if(nums[j]>max) {
        //         max = nums[j]
        //         console.log(max,'111');
        //     }
        // }
        ans = nums.slice(i,k+i);
        console.log(ans,'111')
        max = Math.max(...ans)
        console.log(max,'222')
        res.push(max)
    }
    return res;
}
//console.log(maxSlidingWindow([1,3,-1,-3,5,3,6,7],3))
function a() {
    console.log('123')
    return 1
}
// let array = [1,3,-1,-3,5,3,6,7];
// let a = array.slice(0,3);
// console.log(a)
// a = array.slice(1,4)
// console.log(a)
console.log(a())
